import requestProxy from '@/utils/request';
const { request } = requestProxy;

export function getAbandonList(params, cancelToken) {
  return request({
    url: 'admin/invoiceAbandon/list',
    method: 'get',
    params,
    cancelToken
  });
}

export function getAbandonTab(params) {
  return request({
    url: 'admin/invoiceAbandon/tab',
    method: 'get',
    params
  });
}
export function deleteAbandon(id) {
  return request({
    url: `admin/invoiceAbandon/delete/${id}`,
    method: 'delete'
  });
}

export function createAbandon(data) {
  return request({
    url: 'admin/invoiceAbandon/create',
    method: 'post',
    data
  });
}
export function editAbandon(data) {
  return request({
    url: `admin/invoiceAbandon/edit/${data.id}`,
    method: 'put',
    data
  });
}
export function formSubmitAbandon(data) {
  return request({
    url: 'admin/invoiceAbandon/formSubmit',
    method: 'post',
    data
  });
}

export function getAbandonDetail(params) {
  return request({
    url: `admin/invoiceAbandon/${params.id}`,
    method: 'get'
  });
}
// 签约审批-流程审批
export function invoiceAbandonProcessAudit(data) {
  return request({
    url: '/admin/invoiceAbandon/process/audit',
    method: 'post',
    data
  });
}
// 发票作废审批 - 流程 - 撤销
export function invoiceAbandonProcessRevocation(data) {
  return request({
    url: '/admin/invoiceAbandon/process/revocation',
    method: 'post',
    data
  });
}
// 签约审批 - 流程 - 撤回
export function invoiceAbandonProcessRecall(data) {
  return request({
    url: '/admin/invoiceAbandon/process/recall',
    method: 'post',
    data
  });
}
// 发表评论
export function invoiceAbandonCommentAdd(data) {
  return request({
    url: '/admin/invoiceAbandon/comments/add',
    method: 'post',
    data
  });
}
// 评论列表
export function getInvoiceAbandonComments(params) {
  return request({
    url: '/admin/invoiceAbandon/comments/list',
    method: 'get',
    params
  });
}
